// base
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
// less
import './index.less'
import ChooseList from '../choose-list'

class ChoosePart extends Component {
  componentWillMount () {
    // onLoad
  }

  componentDidMount () {
    // onready
  }

  componentDidShow () {
    // onshow
  }

  componentDidHide () {
    // onhide
  }

  componentWillUnmount () {
    // onUnload
  }

  delay (time = 0) {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve()
      }, time)
    })
  }

  render () {
    const {dataSource = [], onChooseChange} = this.props
    return (
      <View className="ChoosePart_id69905">
        {dataSource.map((item, index) => {
          return (
            <ChooseList
              dataWrap={item}
              key={index}
              chooselist={item.value || []}
              onChooseChange={onChooseChange}
            />
          )
        })}
      </View>
    )
  }
}

export default ChoosePart
